import kotlin.reflect.full.memberProperties

object Kotlin {
    const val standardLibrary = "1.4.10"
    const val coroutines = "1.3.9"
}

object AndroidSdk {
    const val min = 28
    const val compile = 29
    const val target = compile
}

object AndroidClient {
    const val appId = "com.seuic.hid_demo"
    const val versionCode = 1
    const val versionName = "1.0"
    const val testRunner = "androidx.test.runner.AndroidJUnitRunner"
}

object BuildPlugins {

    object Versions {
        const val buildToolsVersion = "4.1.0"
        const val gradleVersion = "6.6.1"
    }

    const val androidGradlePlugin = "com.android.tools.build:gradle:${Versions.buildToolsVersion}"
    const val kotlinGradlePlugin =
        "org.jetbrains.kotlin:kotlin-gradle-plugin:${Kotlin.standardLibrary}"
    const val hiltGradlePlugin =
        "com.google.dagger:hilt-android-gradle-plugin:${Libraries.Versions.hilt}"

    const val androidApplication = "com.android.application"
    const val androidLibrary = "com.android.library"
    const val kotlinAndroid = "kotlin-android"
    const val kotlinKapt = "kotlin-kapt"
    const val kotlinAndroidExtensions = "kotlin-android-extensions"
    const val hilt = "dagger.hilt.android.plugin"
}

object ScriptPlugins {
    const val infrastructure = "scripts.infrastructure"
    const val variants = "scripts.variants"
    const val quality = "scripts.quality"
    const val compilation = "scripts.compilation"
}

object Libraries {
    object Versions {
        const val multidex = "2.0.1"
        const val appCompat = "1.2.0"
        const val constraintLayout = "2.0.2"
        const val recyclerView = "1.1.0"
        const val cardView = "1.0.0"
        const val material = "1.1.0"
        const val lifecycle = "2.2.0"
        const val lifecycleExtensions = "2.1.0"
        const val annotations = "1.1.0"
        const val ktx = "1.3.2"
        const val glide = "4.11.0"
        const val retrofit = "2.9.0"
        const val okHttpLoggingInterceptor = "4.9.0"

        const val hilt = "2.28-alpha"
        const val hiltViewModule = "1.0.0-alpha01"
        const val fragment = "1.3.0-alpha06"
        const val rxlifecycle2SdkVersion = "2.2.2"

    }

    const val kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Kotlin.standardLibrary}"
    const val kotlinCoroutines =
        "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Kotlin.coroutines}"
    const val kotlinCoroutinesAndroid =
        "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Kotlin.coroutines}"
    const val appCompat = "androidx.appcompat:appcompat:${Versions.appCompat}"
    const val constraintLayout =
        "androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}"
    const val ktxCore = "androidx.core:core-ktx:${Versions.ktx}"
    const val runtimeKtx = "androidx.fragment:fragment-ktx:${Versions.fragment}"
    const val lifecycleCompiler = "androidx.lifecycle:lifecycle-compiler:${Versions.lifecycle}"
    const val viewModel = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycle}"
    const val liveData = "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifecycle}"
    const val lifecycleExtensions =
        "androidx.lifecycle:lifecycle-extensions:${Versions.lifecycleExtensions}"
    const val androidAnnotations = "androidx.annotation:annotation:${Versions.annotations}"

    const val gson = "com.google.code.gson:gson:2.8.6"
    const val multidex = "androidx.multidex:multidex:${Versions.multidex}"
    const val appStartup = "androidx.startup:startup-runtime:1.0.0-alpha01"


    //UI
    const val cardView = "androidx.cardview:cardview:${Versions.cardView}"
    const val recyclerView = "androidx.recyclerview:recyclerview:${Versions.recyclerView}"
    const val material = "com.google.android.material:material:${Versions.material}"

    //图片加载
    const val glide = "com.github.bumptech.glide:glide:${Versions.glide}"

    const val eventbus = "org.greenrobot:eventbus:3.2.0"

    //okhttp
    const val retrofit = "com.squareup.retrofit2:converter-gson:${Versions.retrofit}"
    const val okHttpLoggingInterceptor =
        "com.squareup.okhttp3:logging-interceptor:${Versions.okHttpLoggingInterceptor}"


    //hilt
    const val hilt = "com.google.dagger:hilt-android:${Versions.hilt}"
    const val hiltCompiler = "com.google.dagger:hilt-android-compiler:${Versions.hilt}"
    const val hiltViewmodel = "androidx.hilt:hilt-lifecycle-viewmodel:${Versions.hiltViewModule}"
    const val hiltViewmodelCompiler = "androidx.hilt:hilt-compiler:${Versions.hiltViewModule}"

    //rx2
    const val rxandroid2 = "io.reactivex.rxjava2:rxandroid:2.1.1"
    const val rxjava2 = "io.reactivex.rxjava2:rxandroid:2.1.1"
    const val rxlifecycle2 =
        "com.trello.rxlifecycle2:rxlifecycle:${Versions.rxlifecycle2SdkVersion}"
    const val rxlifecycle2_android =
        "com.trello.rxlifecycle2:rxlifecycle-android:${Versions.rxlifecycle2SdkVersion}"
    const val rxlifecycle2_components =
        "com.trello.rxlifecycle2:rxlifecycle-components:${Versions.rxlifecycle2SdkVersion}"
    const val rxcache2 = "com.github.VictorAlbertos.RxCache:runtime:1.8.3-2.x"
    const val rxpermissions2 = "com.github.tbruyelle:rxpermissions:0.10.2"
    const val rxerrorhandler2 = "me.jessyan:rxerrorhandler:2.1.1"


    /******三方*******/
    const val utilcode = "com.blankj:utilcode:1.26.0"
    const val keepAlive = "com.gyf.cactus:cactus:1.1.3-beta13"
    const val xpopup = "com.lxj:xpopup:2.2.12"

}

object TestLibraries {
    private object Versions {
        const val junit4 = "4.13.1"
        const val mockk = "1.10.0"
        const val robolectric = "4.4"
        const val kluent = "1.14"
        const val testRunner = "1.1.0"
        const val espressoCore = "3.2.0"
        const val espressoIntents = "3.1.0"
        const val testExtensions = "1.1.1"
        const val testRules = "1.1.0"
        const val timber = "4.7.1"
    }

    const val timber = "com.jakewharton.timber:timber:${Versions.timber}"
    const val logutil = "com.apkfuns.logutils:library:1.7.5"

    const val junit4 = "junit:junit:${Versions.junit4}"
    const val mockk = "io.mockk:mockk:${Versions.mockk}"
    const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
    const val kluent = "org.amshove.kluent:kluent:${Versions.kluent}"
    const val testRunner = "androidx.test:runner:${Versions.testRunner}"
    const val testRules = "androidx.test:rules:${Versions.testRules}"
    const val espressoCore = "androidx.test.espresso:espresso-core:${Versions.espressoCore}"
    const val espressoIntents =
        "androidx.test.espresso:espresso-intents:${Versions.espressoIntents}"
    const val testExtJunit = "androidx.test.ext:junit:${Versions.testExtensions}"
}

object DevLibraries {
    private object Versions {
        const val leakCanary = "2.5"
    }

    const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
}

object PlugeResourse {
    // All consts are accessed via reflection
    const val ALi_central = "https://maven.aliyun.com/repository/central"
    const val ALi_public = "https://maven.aliyun.com/repository/public"
    const val ALi_jcenter = "https://maven.aliyun.com/repository/public"
    const val ALi_google = "https://maven.aliyun.com/repository/google"
    const val ALi_gradle_plugin = "https://maven.aliyun.com/repository/gradle-plugin"

    const val github = "https://jitpack.io"

    // positive" function can not be private"
    fun getAll() = PlugeResourse::class.memberProperties
        .filter { it.isConst }
        .map { it.getter.call().toString() }
        .toSet()
}